//
//  AfriendViewController.m
//  图片故事
//
//  Created by 爽 on 16/3/7.
//  Copyright © 2016年 helloApp. All rights reserved.
//

#import "AfriendViewController.h"
//#import "UMSocial.h"
//#import "UMSocialSinaSSOHandler.h"
#import "AppDelegate.h"
#import "InforTableViewCell.h"
#import "Header.h"
#import <AVFoundation/AVFoundation.h>
//<UMSocialUIDelegate>
@interface AfriendViewController ()
@property (nonatomic,strong)NSArray *icon;
@property (nonatomic,strong)NSArray *informat;

@end

@implementation AfriendViewController

-(NSArray *)icon {
    if (!_icon) {
        _icon = @[@"微博1",@"腾讯",@"人人",@"豆瓣"];
    }
    return _icon;
}
-(NSArray *)informat {
    if (!_informat) {
        //_informat = [[NSArray alloc] init];
        _informat = @[@"用新浪微博告诉好友",@"用腾讯微博告诉好友",@"用人人网告诉好友",@"用豆瓣网告诉好友"];
        
    }
    return _informat;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:Bg_Color];
    self.title = @"告诉朋友";
    self.tableView.rowHeight = 60;
    self.tableView.tableFooterView = [[UIView alloc] init];
    [self.tableView setSeparatorColor:[UIColor grayColor]];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(returnbutton)];
    self.navigationItem.leftBarButtonItem = backItem;
   
}
-(void)returnbutton {
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark -- 数据源
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.informat.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    static NSString *qwe =@"id";
    InforTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:qwe];
    
    
    //对表格进行增加内容
    if (cell==nil) {
        cell=[[InforTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:qwe];
    }
    //取消分割线
    UIView *backView = [[UIView alloc] initWithFrame:cell.frame];
    cell.selectedBackgroundView = backView;
    cell.iconimageView.image = [UIImage imageNamed:self.icon[indexPath.row]];
    cell.inforlabel.text = self.informat[indexPath.row];
    cell.inforlabel.textColor = [UIColor grayColor];
    [cell setBackgroundColor:Btn_Color];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    
}

#pragma mark --代理
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    /*
    if (indexPath.row == 0) {
        [[UMSocialControllerService defaultControllerService] setShareText:@"分享内嵌文字" shareImage:[UIImage imageNamed:@"icon"] socialUIDelegate:self];        //设置分享内容和回调对象
        [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToSina].snsClickHandler(self,[UMSocialControllerService defaultControllerService],YES);
    }else if (indexPath.row == 1) {
        [[UMSocialControllerService defaultControllerService] setShareText:@"分享内嵌文字" shareImage:[UIImage imageNamed:@"icon"] socialUIDelegate:self];        //设置分享内容和回调对象
        [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToTencent].snsClickHandler(self,[UMSocialControllerService defaultControllerService],YES);
    }else if (indexPath.row == 2) {
        [[UMSocialControllerService defaultControllerService] setShareText:@"分享内嵌文字" shareImage:[UIImage imageNamed:@"icon"] socialUIDelegate:self];        //设置分享内容和回调对象
        [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToRenren].snsClickHandler(self,[UMSocialControllerService defaultControllerService],YES);
    }else if (indexPath.row == 3) {
        [[UMSocialControllerService defaultControllerService] setShareText:@"分享内嵌文字" shareImage:[UIImage imageNamed:@"icon"] socialUIDelegate:self];        //设置分享内容和回调对象
        [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToDouban].snsClickHandler(self,[UMSocialControllerService defaultControllerService],YES);
    }
    */
}



@end
